package top.chukongxiang.monitorservice.config.listener;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import top.chukongxiang.monitorservice.config.ApplicationState;
import top.chukongxiang.monitorservice.config.ApplicationStatusContextHolder;

/**
 * @author 楚孔响
 * @version 1.0
 * @date 2023/10/24 11:03
 */
@Component
public class ApplicationStartedListener implements ApplicationListener<ApplicationReadyEvent> {
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        ApplicationStatusContextHolder.setState(ApplicationState.RUNNING);
    }
}
